package com.dempsey.good.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dempsey.good.dao.Good;
import com.dempsey.good.mapper.GoodMapper;
import com.dempsey.good.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Dempsey
 * @description 针对表【good】的数据库操作Service实现
 * @createDate 2022-05-22 09:13:20
 */
@Service
public class GoodServiceImpl extends ServiceImpl<GoodMapper, Good> implements GoodService {

    @Autowired
    private GoodMapper goodMapper;

    @Override
    public List<Good> getGoodByName(String goodName) {
        QueryWrapper<Good> qw = new QueryWrapper<>();
        qw.like("name", goodName);
        List<Good> goodList = list(qw);
        return goodList;
    }

    @Override
    public List<Good> getGoodByType(String goodType) {
        return goodMapper.getGoodListByType(goodType);
    }

    @Override
    public List<Good> getGoodByBrand(String goodBrand) {
        return goodMapper.getGoodListByBrand(goodBrand);
    }

}




